package com.excel;

import java.util.List;
/**
 * 表信息
 * 包括表格的名字，字段信息,主键信息
 * @author mike
 *
 */
public class MyTable   implements java.io.Serializable {

    private String tableName;    
    private List<ColumnInfoBean> columns;
    
    
    private List<String> keys;
    
    
    public String getTableName() {
        return tableName;
    }
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    public List getColumns() {
        return columns;
    }
    public void setColumns(List columns) {
        this.columns = columns;
    }
    
    private ColumnInfoBean getColumn(String aName) {
	 ColumnInfoBean columnInfoBean2 = null;
	for(int i=0; i<columns.size(); i++) {
	    ColumnInfoBean columnInfoBean = (ColumnInfoBean)columns.get(i);
	    String name2 =  columnInfoBean.getName();
	    if(aName.equalsIgnoreCase(name2)) {
		columnInfoBean2 = columnInfoBean;
	    }
	}
	return columnInfoBean2;
    }
    
    
    /**
     * 根据列名取得对应的Bean
     */
    public ColumnInfoBean getColumnInfoBean(String fieldName) {
	for(int i=0; i<columns.size(); i++) {
	    ColumnInfoBean columnInfoBean = columns.get(i);
	    if(fieldName.equalsIgnoreCase(columnInfoBean.getName())) {
		return columnInfoBean;
	    }
	}
	return null;
	
    }
    
    
    
}
